<script type="text/babel">
  import $ from 'jquery'
  export default {
    attached: function () {
      if (this.asset) {
        this.asset.registerCallback(this)
      }
    },
    detached: function () {
      if (this.asset) {
        this.asset.unregisterCallback(this)
      }
    },
    methods: {
      focused: function () {
        this.asset.focused()
        $(this.$el).focus()
      },
      disabled: function () {
        this.asset.disabled()
        $(this.$el).blur()
      },
      normal: function () {
        this.asset.normal()
        $(this.$el).blur()
      }
    }
  }
</script>